#ifndef _THREAD_INFO_H_
#define _THREAD_INFO_H_

#include "list.h"
#include "types.h"
#include "platform.h"


#define PTHREAD_STACK_MIN 128

/*
 * thread description
 */
struct thread_info {

	/* thread list for wait queue */
	struct list list;

	/* thread attribute */
	struct pthread_attr attr;

	/* user thread function entry */
	void* (*start_routine)(void *arg);
	/* user private data point */
	void *arg;
	/* user thread function return code */
	void *ret;

	/* handle for lower OS task handle */
	void *task;

	/* socket error code */
	err_t sock_errno;
};

INLINE int check_current(void *task)
{
	return (get_current() == task);
}

#define current (get_current())

#endif
